package com.ganzi.manager.activiti.model;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;
import com.baomidou.mybatisplus.enums.IdType;
import com.ganzi.manager.base.BaseModel;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;

/**
 * 表单信息
 * @since 2019-05-23
 */
@Data
@Builder
@EqualsAndHashCode(callSuper = true)
@TableName("form_information")
public class FormInformation extends BaseModel<FormInformation> {


    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 表单名称
     */
    private String name;
    /**
     * 表单key
     */
    private String formKey;
    /**
     * 具体信息
     */
    private String parseForm;
    /**
     * 表单中参与流程的变量
     * {
     * "days":{"type":"number","fileName":"请假天数"},
     * "types":{"type":"radio","fileName":"请假类型","value":{"1":"事假","0":"病假"}}
     * }
     */
    private String processParam;
    /**
     * 表单的json格式   （数组）
     * [
     * {"name":"textarea","fileName":"多行文本框","type":"textarea","value":""},
     * {"name":"days","fileName":"","type"普通文本以及其他类型:"text","value":""},
     * {"name":"types","fileName":"单选框类型","type":"radio","value":{"1":"事假","2":"病假"}},
     * {"name":"checkboxs","fileName":"复选框类型","type":"checkbox","value":"{"1":"事假","2":"病假"}}
     * ]
     */
    private String parseJson;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
